Swapping evaluation: A memory-scalable solution for answer-on-demand tabling
نویسندگان
چکیده
One of the differences among the various approaches to suspension-based tabled evaluation is the scheduling strategy. The two most popular strategies are local and batched evaluation. The former collects all the solutions to a tabled predicate before making any one of them available outside the tabled computation. The latter returns answers one by one before computing them all, which in principle is better if only one answer (or a subset of the answers) is desired. Batched evaluation is closer to SLD evaluation in that it computes solutions lazily as they are demanded, but it may need arbitrarily morememory than local evaluation, which is able to reclaim memory sooner. Some programs which in practice can be executed under the local strategy quickly run out of memory under batched evaluation. This has led to the general adoption of local evaluation at the expense of the more depth-first batched strategy. In this paper we study the reasons for the high memory consumption of batched evaluation and propose a new scheduling strategy which we have termed swapping evaluation. Swapping evaluation also returns answers one by one before completing a tabled call, but its memory usage can be orders of magnitude less than batched evaluation. An experimental implementation in the XSB system shows that swapping evaluation is a feasible memory-scalable strategy that need not compromise execution speed.
منابع مشابه
On Applying Or-Parallelism and Tabling to Logic Programs
Logic Programming languages, such as Prolog, provide a high-level, declarative approach to programming. Logic Programming offers great potential for implicit parallelism, thus allowing parallel systems to often reduce a program’s execution time without programmer intervention. We believe that for complex applications that take several hours, if not days, to return an answer, even limited speedu...
متن کاملAchieving Scalability in Parallel Tabled Logic Programs
Tabling or memoing is a technique where one stores intermediate answers to a problem so that they can be reused in further calls. Tabling is of interest to logic programming because it addresses some of most significant weaknesses of Prolog. Namely, it can guarantee termination for programs with the bounded term-size property. Tabled programs exhibit a more complex execution mechanism than trad...
متن کاملA Simple and Efficient Implementation of Concurrent Local Tabling
Newer Prolog implementations commonly offer support for multi-threading, and have also begun to offer support for tabling. However, most implementations do not yet integrate tabling with multithreading, and in particular do not support the sharing of a tabled computation among threads. In this paper we present algorithms to share completed tables among threads based on Concurrent Local SLG eval...
متن کاملEecient Tabling Mechanisms for Logic Programs
The use of tabling in logic programming allows bottom-up evaluation to be incorporated in a top-down framework, combining advantages of both. At the engine level, tabling also introduces complications not present in pure top-down evaluation, due to the need for subgoals and answers to access tables during clause resolution. This paper describes the design, implementation, and experimental evalu...
متن کاملOn Improving the Efficiency and Robustness of Table Storage Mechanisms for Tabled Evaluation
Most of the recent proposals in tabling technology were designed as a means to improve some practical deficiencies of current tabling execution models that reduce their applicability in particular applications. The discussion we address in this paper was also motivated by practical deficiencies we encountered, in particular, on the table storage mechanisms used for tabling support. To improve s...
متن کاملذخیره در منابع من
با ذخیره ی این منبع در منابع من، دسترسی به آن را برای استفاده های بعدی آسان تر کنید
عنوان ژورنال:
- TPLP
دوره 10 شماره
صفحات -
تاریخ انتشار 2010